// MiniCC.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <cassert>
#include "Scanner.h"
#include "Grammar.h"

using namespace std;


int main(int argc, char* argv[])
{
	Scanner scanner;
	vector<SYMBOL> result = scanner.scan();
	Grammar g;
	g.printOutFirstSet();
	g.printOutFollowSet();
	g.printOutPredictSet();
	g.printOutParseTable();

	cout << "\n--------------- Tokens----------------\n";

	for(vector<SYMBOL>::iterator iter = result.begin(); iter != result.end(); iter++)
	{
		cout << SYMBOL_str[*iter] << " , ";
	}
	cout << "\n";

	ParseTreeNode* root = g.constructParseTree(result);
	Grammar::traverseTree(root);

	return 0;
}
